package com.example.lanouhn.bantangapp.activities.utils;


import com.example.lanouhn.bantangapp.activities.contants.LoginNP;

import org.json.JSONObject;

import java.util.ArrayList;
import java.util.List;

/**
 * 解析Json数据
 */
public class JsonUtils_LoginNP {

    /**
     * @param json json字符串
     * @return 登录
     */
    public static LoginNP getlloginList(String json) {
        LoginNP list = new LoginNP();
        try {
            JSONObject jsonObject = new JSONObject(json);


            JSONObject object = jsonObject.getJSONObject("data");


            list.setAccess_token(object.getString("access_token"));
            list.setUser_id(object.getString("user_id"));
            list.setNickname(object.getString("nickname"));

        } catch (Exception e) {
            e.printStackTrace();
        }
        return list;
    }
}
